package com.ruoyi.web.controller.callback;

import com.ruoyi.callback.service.CarService;
import com.ruoyi.callback.service.IteamService;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;



/**
 * @date 2024/12/20 9:54
 * @desc 北斗车队和车辆回调
 **/
@RestController
@RequestMapping("/callback")
public class CallbackController {



    @Autowired
    private IteamService iteamService;


    @Autowired
    private CarService carService;
    /**
     * 车辆-->添加回调
     */
    @PostMapping("/addCarCallback")
    public void addCarCallback(@RequestBody String body)
    {
        System.out.println("addCarCallback================"+body);
        carService.addCarCallback(body);
    }

    /**
     * 车辆-->修改回调
     */
    @RequestMapping ("/updateCarCallback")
    public void updateCarCallback(@RequestBody String body)
    {
        System.out.println("updateCarCallback================"+body);
        carService.updateCarCallback(body);
    }


    /**
     * 车辆-->删除回调
     */
    @PostMapping("/delCarCallback")
    public void delCarCallback(@RequestBody String body)
    {
        System.out.println("delCarCallback================"+body);
        carService.delCarCallback(body);
    }

    /**
     * 车队-->添加回调
     */

//    {
//        "atime": "2024-12-27 19:59:57",
//            "auser": "admin_gj",
//            "banNum": 0,
//            "carNum": 0,
//            "cmpId": "7",
//            "delNum": 0,
//            "des": "36",
//            "email": "35",
//            "exts": "{\"old_team_id\":\"12\",\"user_id\":\"2\",\"name\":\"3\",\"short_name\":\"4\",\"enterprise_type\":\"5\",\"jurisdiction\":\"6\",\"enterprise_number\":\"7\",\"legal_person\":\"8\",\"max_car_num\":\"9\",\"vehicle_management_contact\":\"10\",\"vehicle_management_contact_phone\":\"11\",\"road_transport_permit_number\":\"12\",\"construction_waste_registration_\":\"13\",\"valid_until\":\"14\",\"social_credit_code\":\"15\",\"legal_person_id_attachment\":\"16\",\"qualification_certificate_attach\":\"17\",\"business_license_attachment\":\"18\",\"other_attachment\":\"19\",\"exts\":\"20\",\"address\":\"21\",\"pic\":\"22\",\"pic_contact\":\"23\",\"des\":\"24\",\"province_code\":\"25\",\"province_name\":\"26\",\"city_code\":\"27\",\"city_name\":\"28\",\"area_code\":\"29\",\"area_name\":\"30\",\"town_name\":\"31\",\"town_code\":\"32\"}",
//            "id": "4458",
//            "linkman": "33",
//            "maxCarNum": "{\"num\":1,\"2G\":2,\"4G\":3,\"28181G\":4}",
//            "name": "车队",
//            "noAuth": false,
//            "phone": "34",
//            "pid": "4327",
//            "seq": 10715086071862673000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,
//            "videoNum": 0,
//            "zcode": "13_河北省"
//    }

    @PostMapping("/addTeamCallback")
    public void addTeamCallback(@RequestBody String body)
    {
        System.out.println("addTeamCallback================"+body);
        iteamService.addTeamCallback(body);
    }

    /**
     * 车队-->修改回调
     */
    @RequestMapping ("/updateTeamCallback")
    public void updateTeamCallback(@RequestBody String body)
    {
        System.out.println("updateTeamCallback================"+body);
        iteamService.updateTeamCallback(body);
    }


    /**
     * 车队-->删除回调
     */
    @PostMapping("/delTeamCallback")
    public void delTeamCallback(@RequestBody String body)
    {
        System.out.println("delTeamCallback================"+body);
        iteamService.delTeamCallback(body);
    }


}
